require "aio/constants"
require "aio/errors"
require "aio/board"
require "aio/sketch"
require "aio/helpers"

# {https://github.com/jvalencia80/aio Aio} (Arduino Input/Output) is a robust 
# library with built-in redundancy check for data integrity and command 
# confirmation for remotely controlling {http://arduino.cc Arduino}
# boards using Ruby code and the serial port.
# 
# It implements lots of functions found in the
# {http://arduino.cc/en/Reference/HomePage Arduino Reference} and they even 
# share the same names and parameters for an easier experience.
#
# * Currently, these boards are fully supported (and many others should work):
# 
#   * UNO, Duemilanove, Diecimila, Pro
#   * Leonardo, Yun, Micro
#   * Mega, Mega 2560, Mega ADK
#   * Nano, Mini, Fio, Pro Mini
# 
# * Supported functions implemented in the {Aio::Board Aio::Board} class:
# 
#   * pinMode
#   * digitalRead, digitalWrite
#   * analogRead, analogWrite, analogReference
#   * millis
#
# * Supported constants:
# 
#   * LOW, HIGH
#   * INPUT, INPUT_PULLUP, OUTPUT
#   * DEFAULT, INTERNAL, EXTERNAL, INTERNAL1V1, INTERNAL2V56
# 
# * Other supported functions (see {Aio::Helpers Aio::Helpers} module):
# 
#   * lowByte, highByte, bit, bitClear, bitSet, bitRead, bitWrite
#   * min, max, abs, pow, sqrt, map, constrain
#   * sin, cos, tan
#   * random, randomSeed
# 
# = Example
# 
# Blinking a LED:
# 
#   require "aio"
#   
#   Aio::Board.new("/dev/ttyUSB0") do |board|
#     sleep 0.1 until board.ready?
#
#     board.pinMode(13, Aio::OUTPUT)
#     
#     5.times do
#       board.digitalWrite(13, Aio::HIGH)
#       sleep 0.5
#       board.digitalWrite(13, Aio::LOW)
#       sleep 0.5
#     end
#   end
# 
# Check more examples at the {https://github.com/jvalencia80/aio/tree/master/examples Github}
# page.
# 
# = Installation
# 
# 1. Install the {https://rubygems.org/gems/aio Aio} gem:
# 
#      $ gem install aio
# 
# 2. Print the sketch required by the library:
# 
#      $ aiosketch > sketch.ino
#
#    or
#
#      $ ruby -raio -e "Aio.print_sketch" > sketch.ino
# 
# 3. Compile and burn the sketch using the {http://arduino.cc/en/Main/Software Arduino IDE}.
# 
# = Limitations
# 
# - As this library uses the Arduino serial port, digital pins *0* and *1* must not be used.
#
# - This library code isn't executed in realtime as Arduino does, and the communication
#   protocol is relatively slow, so trying to make code that requires exact timing is tricky.
#
# - Also take into account that this library does not check if *PIN* *X* is available in
#   *BOARD* *Z*, or if the value supplied is valid or not for a specific command,
#   so check your board's documentation first.
#
# - This library is *NOT* thread safe.
#
# = Issues
#
# Post any issues at the {https://github.com/jvalencia80/aio/issues Github issue tracker}.

module Aio
	# Prints the Arduino sketch to STDOUT.
	#
	# @return [nil]
	
	def self.print_sketch
		STDOUT.puts SKETCH.gsub(/\t/,'')
		nil
	end
end
